<template>
    <div class="image-show-layout">
        <yd-slider autoplay="0" :index="index">
            <yd-slider-item v-for="(item, key) in imageList">
                <div >
                    <img class="image-content-part" :src="item">
                </div>
            </yd-slider-item>
        </yd-slider>
    </div>
</template>

<script>
    export default {
        name: "imageShow",
        data() {
            return {
                imageList: [],
                index: 0,
            }
        },
        created() {
            this.imageList = this.$route.params.imageList;
            console.log(this.imageList);
            this.index = this.$route.params.index;
            // var images = [];
            // images = this.$route.params.imageList;
            // this.index = this.$route.params.index;
            // if (this.index === 0) {
            //     this.imageList = images;
            // } else {
            //     var startImages = images.splice(0,this.index);
            //     var endImages = images.splice(this.index);
            //     this.imageList = [...endImages,...startImages];
            // }
        }
    }
</script>

<style lang="scss">
    .image-show-layout {
        width: 100%;
        height: 100%;

        .image-content-part {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
    }
</style>